﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CSharp.Study.IOTest.IOProjects
{
    public class T_Binary
    {
        public static void Go()
        {
            string filepath = "E:/Files/log.txt";
            {
                using var stream = File.Open(filepath, FileMode.Open);
                using var writer = new BinaryWriter(stream, Encoding.UTF8);
                writer.Write("aaa");
                writer.Write(1.250F);
                writer.Write(10);
                writer.Write(true);
            }
            {
                using var stream = File.Open(filepath, FileMode.Open);
                using var reader = new BinaryReader(stream, Encoding.UTF8);
                string s = reader.ReadString();
                float f = reader.ReadSingle();
                int i = reader.ReadInt32();
                bool b = reader.ReadBoolean();
            }
            
        }
    }   
}
